package com.ww.aiinterviewer.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ww.aiinterviewer.model.dto.chatroom.ChatRoomQueryRequest;
import com.ww.aiinterviewer.model.entity.ChatRoom;
import com.ww.aiinterviewer.model.vo.ChatRoomVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 聊天房间服务
 *
 * @author 15357
 */
public interface ChatRoomService extends IService<ChatRoom> {

    /**
     * 校验
     *
     * @param chatRoom
     * @param add
     */
    void validChatRoom(ChatRoom chatRoom, boolean add);

    /**
     * 获取查询条件
     *
     * @param chatRoomQueryRequest
     * @return
     */
    QueryWrapper<ChatRoom> getQueryWrapper(ChatRoomQueryRequest chatRoomQueryRequest);
    

    /**
     * 获取聊天房间封装
     *
     * @param chatRoom
     * @return
     */
    ChatRoomVO getChatRoomVO(ChatRoom chatRoom);

    /**
     * 分页获取聊天房间封装
     *
     * @param chatRoomPage
     * @param request
     * @return
     */
    Page<ChatRoomVO> getChatRoomVOPage(Page<ChatRoom> chatRoomPage, HttpServletRequest request);

    List<ChatRoomVO> getChatRoomVOList(HttpServletRequest request);
}
